@import '../../assets/scss/variables';
@import '../../assets/scss/mixins';

.container {
  background-color: $color-gray-bg;
  @include padding-equal(0.5);
  @include margin-bottom(0.5);

  * {
    margin: 0 auto;
  }

  p {
    font-size: $typographic-base-font-size * 0.9;
    @include line-height(0.8);

    &.recaptcha-message {
      @include margin-top(0.25);
      color: $color-gray;
      font-size: $typographic-base-font-size * 0.5625;
      text-align: center;
      @include line-height(0.45);
    }
  }

  form {
    text-align: center;

    label {
      font-size: $typographic-base-font-size * 0.9;

      /* Make the label unselectable */
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      -o-user-select: none;
      user-select: none;
    }
  }

  input[type='email'] {
    max-width: 90%;
    background-color: white;
    border: 1px solid white;
    border-radius: 5px;
    padding: 8px 10px;
    /* need min 16px below to avoid page zooming in when input is focused on iOS */
    font-size: $typographic-base-font-size * 1;
    @include margin-top(0.25);
    @include margin-bottom(0.1);
    @include transition(box-shadow);

    &:hover, &:focus {
      box-shadow: 0 0 10px $color-gray-light-shadow;
    }
  }

  input[type='submit'] {
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 3px;
    background-color: $color-primary;
    color: white;
    font-size: $typographic-base-font-size * 0.75;
    font-weight: bold;
    margin: 0 auto;
    padding: 10px 30px;
    @include margin-top(0.3);
    @include transition(background-color);

    &:hover {
      background-color: $color-secondary;
      cursor: pointer;
    }

    &.loading {
      background-color: $color-gray;
      cursor: progress;
    }
  }

  input[type='checkbox'], input[type='radio'] {
    margin-right: 3px;
  }

  .form-container {
    display: flex;
    flex-direction: row;

    & > div {
      flex: 1;
    }
  }
}

@include breakpoint-sm {
  .container {
    border-radius: 5px;
    @include margin-bottom(0.75);
  }
}

@include breakpoint-md {
  .container.large {
    @include padding-equal(1);
    @include margin-bottom(0.75);

    p {
      font-size: $typographic-base-font-size * 1.2;
      @include line-height(1.1);

      &.recaptcha-message {
        @include margin-top(0.3);
        font-size: $typographic-base-font-size * 0.6;
        @include line-height(0.5);
      }
    }

    form label {
      font-size: $typographic-base-font-size * 1.1;
    }

    input[type='checkbox'], input[type='radio'] {
      margin-right: 5px;
    }

    input[type='email'] {
      padding: 10px 40px;
      font-size: $typographic-base-font-size * 1.2;
      @include margin-top(0.4);
      @include margin-bottom(0.2);
    }

    input[type='submit'] {
      font-size: $typographic-base-font-size * 0.9;
      padding: 15px 40px;
      @include margin-top(0.4);
    }
  }
}

.container.no-spacing {
  margin: 0;
  padding: 0;
}
